Skip to content

opentelemetry-test-utils: skip installing grpc exporter only on Pypy#5178

Open
xrmx wants to merge 8 commits into
open-telemetry:mainfrom
xrmx:fix-dependabot-test-utils
Open

opentelemetry-test-utils: skip installing grpc exporter only on Pypy#5178
xrmx wants to merge 8 commits into
open-telemetry:mainfrom
xrmx:fix-dependabot-test-utils

Conversation

@xrmx
Copy link
Copy Markdown
Contributor

@xrmx xrmx commented May 5, 2026

Description

Builds on windows takes <1 minute on CPython, so skip only installing grpc on PyPy that is both flaky and slow to install the dependencies. Hopefully it's enough to make dependabot happy again.

Thanks @emdneto for the help.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

…constraint file

For some reason dependabot fails parsing them.
@xrmx xrmx requested a review from a team as a code owner May 5, 2026 13:48
@xrmx xrmx marked this pull request as draft May 5, 2026 13:50
@xrmx
Copy link
Copy Markdown
Contributor Author

xrmx commented May 5, 2026

This does not seem to work, locally I have:

diff --git a/tests/opentelemetry-test-utils/test-requirements-constraints.txt b/tests/opentelemetry-test-utils/test-requirements-constraints.txt
new file mode 100644
index 000000000..5501c80e5
--- /dev/null
+++ b/tests/opentelemetry-test-utils/test-requirements-constraints.txt
@@ -0,0 +1,5 @@
+# these are required for weaver integration tests, we're running that only on linux / CPython
+# because of lack of support for gRPC on Windows in some cases.
+./opentelemetry-proto ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./exporter/opentelemetry-exporter-otlp-proto-common ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./exporter/opentelemetry-exporter-otlp-proto-grpc ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
diff --git a/tests/opentelemetry-test-utils/test-requirements.txt b/tests/opentelemetry-test-utils/test-requirements.txt
index 6b4dbcec0..7c066ea39 100644
--- a/tests/opentelemetry-test-utils/test-requirements.txt
+++ b/tests/opentelemetry-test-utils/test-requirements.txt
@@ -13,9 +13,6 @@ zipp==3.19.2
 -e opentelemetry-sdk
 -e opentelemetry-semantic-conventions
 -e tests/opentelemetry-test-utils
-# these are required for weaver integration tests, we're running that only on linux / CPython
-# because of lack of support for gRPC on Windows in some cases.
-# note: tox does not support PEP 508 markers on `-e` editable installs, so these are installed non-editable
-./opentelemetry-proto ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
-./exporter/opentelemetry-exporter-otlp-proto-common ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
-./exporter/opentelemetry-exporter-otlp-proto-grpc ; sys_platform != 'win32' and platform_python_implementation != 'PyPy'
+./opentelemetry-proto
+./exporter/opentelemetry-exporter-otlp-proto-common
+./exporter/opentelemetry-exporter-otlp-proto-grpc
diff --git a/tox.ini b/tox.ini
index d1c5aff8c..4fcbebba9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -123,6 +123,7 @@ deps =
   semantic-conventions: -r {toxinidir}/opentelemetry-semantic-conventions/test-requirements.txt
 
   test-utils: -r {toxinidir}/tests/opentelemetry-test-utils/test-requirements.txt
+  test-utils: -c {toxinidir}/tests/opentelemetry-test-utils/test-requirements-constraints.txt
 
   opentelemetry-proto-gen-oldest: -r {toxinidir}/opentelemetry-proto/test-requirements.oldest.txt
   opentelemetry-proto-gen-latest: -r {toxinidir}/opentelemetry-proto/test-requirements.latest.txt

and I get

py310-test-opentelemetry-test-utils: install_deps> .tox/.tox/bin/uv pip install -r /home/rm/src/opentelemetry-python/tests/opentelemetry-test-utils/test-requirements.txt -c /home/rm/src/opentelemetry-python/tests/opentelemetry-test-utils/test-requirements-constraints.txt
error: Unnamed requirements are not allowed as constraints (found: `file:///home/rm/src/opentelemetry-python/opentelemetry-proto ; platform_python_implementation != 'PyPy' and sys_platform != 'win32'`)

Comment thread tests/opentelemetry-test-utils/test-requirements-constraints.txt Outdated
Comment thread tests/opentelemetry-test-utils/test-requirements.txt Outdated
Comment thread tox.ini Outdated
Co-authored-by: Emídio Neto <9735060+emdneto@users.noreply.github.com>
Comment thread tox.ini Outdated
emdneto added 2 commits May 5, 2026 11:48
Change paths for dependencies in test-requirements.txt
@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label May 8, 2026
@xrmx
Copy link
Copy Markdown
Contributor Author

xrmx commented May 8, 2026

Uhm looks like this does not work as expected since we're installing grpc on windows and on pypy, said that since it looks like grpc is installed without issues we may just update this to drop on pypy and see if that'll make dependabot happy.

Comment thread tests/opentelemetry-test-utils/test-requirements.txt
@xrmx xrmx changed the title opentelemetry-test-utils: move requirements environment markers to a constraint file opentelemetry-test-utils: skip grpc exporter only on Pypy May 10, 2026
@xrmx xrmx moved this to Easy to review / merge / close in Python PR digest May 10, 2026
@xrmx xrmx marked this pull request as ready for review May 10, 2026 10:13
@xrmx xrmx changed the title opentelemetry-test-utils: skip grpc exporter only on Pypy opentelemetry-test-utils: skip installing grpc exporter only on Pypy May 10, 2026
@xrmx xrmx requested a review from emdneto May 12, 2026 13:07
@github-project-automation github-project-automation Bot moved this from Easy to review / merge / close to Approved PRs in Python PR digest May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

2 participants